<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>查看项目</title>
<script type="text/javascript" src="/res/js/common/jquery.1.9.1.min.js"></script>
<script type="text/javascript" src="/res/js/structure/struture.js"></script> 
<script type="text/javascript" src="/res/js/common/common.js"></script>
<script type="text/javascript" src="/res/third/layer/layer.js"></script>
<script type="text/javascript" src="/res/third/laydate/laydate.js"></script>
<link href="/res/css/respective/role/role.css" rel="stylesheet">
<link href="/res/third/laydate/need/laydate.css" rel="stylesheet">
</head>
[#assign menucode="branchManage"/]
<body>
	<div class="warp">
		[#include "/front/common/front_headAzt.html"]
		<div class="backcontent">
			[#include "/front/common/front_leftAzt.html"]
			<div class="back-main">
				<div class="mainContent">
		<div class="mainContentWhite">
			<h1>分公司管理</h1>
			<hr>
			<form id="searchItemForm" class="form-horizontal" role="form" action="/orgstruct/showItems" method="post"  >
               <input type="hidden" id="branchCompanyId" name="branchCompanyId" value="${branchCompanyId!}">			
              <div>
				<label>查询发布时间：</label> <input type="text" class="time laydate-icon" style="width: 100px;" id="so_sdate" name="so_sdate" autocomplete="off" value="${sdatetime!}"
					 readonly=""/>至 <input type="text" class="time laydate-icon" style="width: 100px;" id="so_endate" name="so_endate" value="${endatetime!}" />
				<button class="sav" type="button" onclick="searchtime();" style="height: 32px;">确定</button>
				<div class="search">
					<input type="text" class="time" style="margin-right: 0px;width: 230px;" id="so_keyword"  name="so_keyword" value="${keyword!}" placeholder="请输入项目名称、客户名称的关键词" />
					<button type="button" onclick="search();">搜索</button>
				</div>
			</div>
			</form>
			<table class="table noBorder">
				<thead>
					<tr>
						<th>项目名称</th>
						<th>甲方名称</th>
						<th>状态</th>
						<th>发布时间</th>
						<th>发布人</th>
						<th>询价单数量</th>
						<th>下单总额</th>
						<th>已支付金额</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<!--默认显示8行-->
					[#if pagination??]
					[#list pagination.list as projectItem]
					<tr>
						<td>${projectItem.projectName!}</td>
						<td>${projectItem.customerName!}</td>
						<td>[#if projectItem.state==1]进行中[/#if][#if
							projectItem.state==2]已关闭[/#if]</td>
						<td>[#if
							projectItem.createtime??]${projectItem.createtime?string("yyyy-MM-dd")!}[/#if]</td>
						<td>${projectItem.publishPerson!}</td>
						<td>${projectItem.enquiryCount!}</td>
						<td class="contentBold">${projectItem.orderprice!}[#if
							projectItem.orderprice>0]<a class="loolPrice" projectId="${projectItem.id!}" href="javascript:void(0);">订单详情</a>[/#if]
						</td>
						<td class="contentBold">${projectItem.orderpay!}[#if
							projectItem.orderpay>0]<a class="loolOrder" projectId="${projectItem.id!}" href="javascript:void(0);">支付详情</a>[/#if]
						</td>
						<td><a class="lookDetail" href="/enquiry/project/detail/p/${projectItem.id!}/t/1" >项目详情</a></td>
					</tr>
					[/#list]
					[/#if]
				</tbody>
				 <tfoot class="goFenYe">
			[@fenye p = pagination form = 'infoForm' /]
			</tfoot>
			</table> 
		</div>
	</div>
			</div>
			<!-- 底部菜单-->
			[#include "/front/common/front_footerAzt.html"]
		</div>
		<div id="loolitem" style="display:none"></div>
	</div>
	<script type="text/javascript">
	      var start = {
			  elem: '#so_sdate',
			  format: 'YYYY/MM/DD',
			  [#if endatetime??]
	          max:'${endatetime!}',
	          [/#if]
			  istime: false,
			  istoday: false,
			  choose: function(datas){
				 end.min=datas;
			     end.start = datas; //将结束日的初始值设定为开始日
			  }
			};
			var end = {
			  elem: '#so_endate',
			  format: 'YYYY/MM/DD',
			  [#if sdatetime??]
			  min: '${sdatetime!}',
			  [/#if]
			  istime: false,
			  istoday: false,
			  choose: function(datas){
			    start.max = datas; //结束日选好后，重置开始日的最大日期
			  }
			};
				
			laydate(start);
			laydate(end);

		//时间范围选择
		function searchtime() {
			var startdate = $("#so_sdate").val();
			var enddate = $("#so_endate").val();
			//时间搜索时去掉关键词
			$("#so_keyword").val('');
			if (enddate != '' && startdate == '') {
				layer.msg('请选择开始时间!' , {time:2000});
				return false;
			}else{
				$("#searchItemForm").submit();
			}
		}

		//关键词搜索带时间条件
		function search() {
			var startdate = $("#so_sdate").val();
			var enddate = $("#so_endate").val();
			if (enddate != '' && startdate == '') {
				layer.msg('请选择开始时间!' , {time:2000});
				return false;
			}else{
				$("#searchItemForm").submit();
			}
			
		}

	</script>
</body>
</html>
